VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form FrmThongKeDaoDuc 
   Caption         =   "Thong ke dao duc"
   ClientHeight    =   8580
   ClientLeft      =   120
   ClientTop       =   450
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   ScaleHeight     =   8580
   ScaleWidth      =   12000
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame 
      Caption         =   "Thong tin chi tiet"
      Height          =   2055
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   11775
      Begin VB.CommandButton btnChonDaoDuc 
         Caption         =   "..."
         Height          =   375
         Left            =   5280
         TabIndex        =   10
         Top             =   480
         Width           =   375
      End
      Begin VB.TextBox txtNamHoc 
         Height          =   375
         Left            =   7560
         TabIndex        =   8
         Top             =   960
         Width           =   3615
      End
      Begin VB.TextBox txtHKy 
         Height          =   375
         Left            =   1800
         TabIndex        =   6
         Top             =   960
         Width           =   3855
      End
      Begin VB.CommandButton btnThongKe 
         Caption         =   "Thong ke"
         Height          =   375
         Left            =   9960
         TabIndex        =   2
         Top             =   1560
         Width           =   1215
      End
      Begin VB.TextBox txtDiemDD 
         Height          =   375
         Left            =   1800
         TabIndex        =   1
         Top             =   480
         Width           =   3375
      End
      Begin VB.Label Label4 
         Caption         =   "Nam hoc"
         Height          =   255
         Left            =   6360
         TabIndex        =   9
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "Hoc ky"
         Height          =   255
         Left            =   600
         TabIndex        =   7
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "Diem dao duc"
         Height          =   255
         Left            =   600
         TabIndex        =   3
         Top             =   600
         Width           =   1095
      End
   End
   Begin MSComctlLib.ListView lstvData 
      Height          =   5895
      Left            =   120
      TabIndex        =   4
      Top             =   2640
      Width           =   11775
      _ExtentX        =   20770
      _ExtentY        =   10398
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      Appearance      =   1
      NumItems        =   0
   End
   Begin VB.Label Label 
      Caption         =   "Danh sach sinh vien tim thay"
      Height          =   255
      Index           =   0
      Left            =   240
      TabIndex        =   5
      Top             =   2280
      Width           =   4095
   End
End
Attribute VB_Name = "FrmThongKeDaoDuc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_ObjADORst  As ADODB.Recordset
Private m_objXepLoaiDD As clsXepLoaiDaoDuc
Private m_sMaDD As String
Private WithEvents formDiemDaoDuc As FrmDiemDaoDuc
Attribute formDiemDaoDuc.VB_VarHelpID = -1

Public Sub Init()
    lstvData.ColumnHeaders.Clear
    lstvData.ColumnHeaders.Add , , "Ma SV", lstvData.Width / 7
    lstvData.ColumnHeaders.Add , , "HoTen", lstvData.Width / 7
    lstvData.ColumnHeaders.Add , , "Ten Lop", lstvData.Width / 7
    lstvData.ColumnHeaders.Add , , "Ten Nganh", lstvData.Width / 7
    lstvData.ColumnHeaders.Add , , "HKy", lstvData.Width / 7
    lstvData.ColumnHeaders.Add , , "Nam Hoc", lstvData.Width / 7
    lstvData.ColumnHeaders.Add , , "DiemDD", lstvData.Width / 7
End Sub

Private Sub btnChonDaoDuc_Click()
    Set formDiemDaoDuc = New FrmDiemDaoDuc
    formDiemDaoDuc.EnableBtnChon = True
    formDiemDaoDuc.Show 1, Me
End Sub

Private Sub btnThongKe_Click()
    Dim i As Integer
    Dim vLstViewItem As ListItem
    
    If txtDiemDD.Text = "" Then m_sMaDD = ""
    
    Set m_objXepLoaiDD = New clsXepLoaiDaoDuc
    Set m_ObjADORst = m_objXepLoaiDD.ThongKe(m_sMaDD, txtHKy.Text, txtNamHoc.Text)
    lstvData.ListItems.Clear
    i = 1
        
    Do While Not m_ObjADORst.EOF
        Set vLstViewItem = lstvData.ListItems.Add(i)
        vLstViewItem = m_ObjADORst!masv
        vLstViewItem.SubItems(1) = m_ObjADORst!HoDem + " " + m_ObjADORst!tensv
        vLstViewItem.SubItems(2) = m_ObjADORst!tenlop
        vLstViewItem.SubItems(3) = m_ObjADORst!tennganh
        vLstViewItem.SubItems(4) = m_ObjADORst!hky
        vLstViewItem.SubItems(5) = m_ObjADORst!namhoc
        vLstViewItem.SubItems(6) = m_ObjADORst!diemdd
        m_ObjADORst.MoveNext
        i = i + 1
    Loop
End Sub

Private Sub Form_Load()
    Init
End Sub

Private Sub formDiemDaoDuc_EVENTChooseItem(ByVal madd As String, ByVal diemdd As String)
    m_sMaDD = madd
    txtDiemDD.Text = diemdd
End Sub

